package sk.naive.talker.command;

import sk.naive.talker.*;

import java.rmi.RemoteException;
import java.util.*;

/**
 *
 * @author <a href="mailto:virgo@naive.deepblue.sk">Richard "Virgo" Richter</a>
 * @version $Revision: 1.14 $ $Date: 2004/11/14 17:43:47 $
 */
public abstract class NonaddressedMessageCommand extends AbstractMessageCommand {
	public void exec()
		throws CommandException,
		RemoteException
	{
		if (params == null || params.length() == 0) {
			sendMisusageWarning();
			return;
		}
		sendNonaddressedMessage(user, params);
	}

	protected void sendNonaddressedMessage(User sender, String s) throws RemoteException, CommandException {
		Collection excluded = new HashSet();
		sendPublicMessage(sender, s, excluded);
	}
}
